module;
#include <iostream>
#include <thread>

export module Code_2_1;

void hello() {
	int a = 0;
	for (a; a < 100000; a++) {
	
		std::cout << "Hello Concurrent World\n";
		std::this_thread::sleep_for(std::chrono::milliseconds(120));
	}
}

class BackGroundTask {
public:
	void operator()() const {
		hello();
	}

};
export
namespace Code_2_1 {
	void run_thread() {
		BackGroundTask task;
		std::thread my_thread(task);
		//my_thread.join();
		my_thread.detach();

	}
}
